<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-02-03 01:16:57
 * @LastEditTime: 2023-10-19 16:15:01
 * @LastEditors: 孙开源 && sunkaiyuan@namenode.cn
 * @Description: 盘点单
 */

namespace App\Models;

use App\Traits\MaterialTrait;
use App\Traits\StorageTrait;
use App\Traits\AutoCodeTrait;

class MpcScrap extends BaseModel
    {
    use StorageTrait;
    use AutoCodeTrait;
    use MaterialTrait;
    public $timestamps = true;
    public $table = "sys_mpc_scrap";
    protected $guarded = [];

    /**
     * 标识
     *
     * @var string
     */
    protected $ACSign = 'STORAGE_SCRAP';
    public function status()
        {
        return $this->belongsTo(Dic::class, "status_id", "key")->where(function ($q)
            {
            $q->where("code", 'status_name');
            });
        }
    public function wip()
        {
        return $this->belongsTo(ProProcessesWip::class);
        }
    }